import helpers
from unittest import TestCase
from pagamigo.RequestSession import RequestSession
from pagamigo.Authentication import flow


def logger(data):
    print(data)


class TestAuthentication(TestCase):
    def test_authentication_flow(self):
        credentials = helpers.get_paypal_sandbox_config_from_json()
        session = RequestSession("https://www.sandbox.paypal.com", logger)
        response = flow(session, credentials["paypal_sandbox_email"], credentials["paypal_sandbox_password"],
                        credentials["paypal_sandbox_country"])

        assert response is not None
